package com.kingyun.gpsinspection.purificationservice.facade.service.tdm;

import com.kingyun.gpsinspection.purificationservice.facade.model.jsm.EmployeeVo;
import com.kingyun.gpsinspection.purificationservice.facade.model.jsm.RedisValue;
import com.kingyun.gpsinspection.purificationservice.facade.model.tdm.*;

import java.util.List;

/**
 * Created by liyi on 2016/11/30.
 * 常规操作Service
 */
public interface NormalOperationService {

    /**
     * 新增常规操作信息并发起流程
     *
     * @param employeeVo
     * @param normalOperation 常规操作信息
     * @param workOrderList   工单信息
     * @param uploadFiles     上传附件
     * @param deletedFiles    删除附件
     * @return
     * @throws Exception
     */
    NormalOperation saveNormalOperation(EmployeeVo employeeVo, NormalOperation normalOperation, List<WorkOrderVo> workOrderList, String uploadFiles, String deletedFiles) throws Exception;

    /**
     * 保存常规操作信息
     *
     * @param employeeVo
     * @param normalOperation
     * @return
     * @throws Exception
     */
    NormalOperation save(EmployeeVo employeeVo, NormalOperation normalOperation, TaskRelation taskRelation, List<WorkOrderVo> workOrderList, String uploadFiles, String deletedFiles) throws Exception;

    /**
     * 更新
     *
     * @param employeeVo
     * @param normalOperation
     * @param deletedFiles
     * @throws Exception
     */
    int update(EmployeeVo employeeVo, NormalOperation normalOperation, List<WorkOrderVo> workOrderList, String uploadFiles, String deletedFiles);

    /**
     * 根据流程ID获取常规操作信息
     *
     * @param piid
     * @return
     * @throws Exception
     */
    NormalOperationVo findNormalOperationByPiid(String piid) throws Exception;

    /**
     * 修改信息
     *
     * @param normalOperationVo
     * @return
     * @throws Exception
     */
    int updateById(NormalOperationVo normalOperationVo, TaskLink taskLink) throws Exception;

    /**
     * 处理流程
     *
     * @param employeeVo
     * @param normalOperationVo
     * @param workOrderList
     * @param taskLink
     * @return
     */
    int disposeTask(RedisValue redisValue, EmployeeVo employeeVo, NormalOperation normalOperationVo, List<WorkOrderVo> workOrderList, TaskLink taskLink);

    /**
     * 发起流程
     *
     * @param employeeVo
     * @param normalOperation
     * @param workOrderList
     * @return
     */
    int launchBPM(RedisValue redisValue, EmployeeVo employeeVo, NormalOperation normalOperation, List<WorkOrderVo> workOrderList) throws Exception;

    /**
     * 根据流程实例ID查找对象
     *
     * @param piPiid
     * @return
     */
    NormalOperationVo findVoByPiPiid(String piPiid);

    /**
     * 根据主键查询
     *
     * @param id
     * @return
     */
    NormalOperationVo queryByPrimaryKey(String id);
}
